package util;

import org.apache.spark.sql.SparkSession;


public class HiveUtil {

    public static SparkSession hiveConnect() {
        SparkSession sparkSession = SparkSession
                .builder()
                .appName("sparkhive")
//                .config("hive.metastore.uris","hdfs://192.168.1.171:9000/user/hive/warehouse")
                .config("spark.sql.warehouse.dir", "hdfs://192.168.1.171:9000/user/hive/warehouse")
                .master("local[2]")
                .enableHiveSupport()
                .getOrCreate();
        sparkSession.sparkContext().setLogLevel("error");




        return sparkSession;
    }

}
